Dump platform-defined regs in crash reporting
authorGerald Lejeune <[email protected]>
Thu, 26 Nov 2015 14:47:53 +0000 (15:47 +0100)
committerGerald Lejeune <[email protected]>
Thu, 14 Apr 2016 15:50:22 +0000 (17:50 +0200)
It is up to the platform to implement the new plat_crash_print_regs macro to
report all relevant platform registers helpful for troubleshooting.

plat_crash_print_regs merges or calls previously defined plat_print_gic_regs
and plat_print_interconnect_regs macros for each existing platforms.

NOTE: THIS COMMIT REQUIRES ALL PLATFORMS THAT ENABLE THE `CRASH_REPORTING`
BUILD FLAG TO MIGRATE TO USE THE NEW `plat_crash_print_regs()` MACRO. BY
DEFAULT, `CRASH_REPORTING` IS ENABLED IN DEBUG BUILDS FOR ALL PLATFORMS.

Fixes: arm-software/tf-issues#373
Signed-off-by: Gerald Lejeune <[email protected]>
bl31/aarch64/crash_reporting.S
docs/porting-guide.md
include/plat/arm/common/aarch64/cci_macros.S
include/plat/arm/css/common/aarch64/css_macros.S
plat/arm/board/fvp/include/plat_macros.S
plat/arm/board/juno/include/plat_macros.S
plat/mediatek/mt8173/include/plat_macros.S
plat/nvidia/tegra/include/plat_macros.S
plat/rockchip/common/include/plat_macros.S
plat/xilinx/zynqmp/include/plat_macros.S

index b22ce71ef280c7619f6e2f3b5260ad2cb023a607..7f5a86b06247069f3d6f08534845112936b483cf 100644 (file)
@@ -346,11 +346,8 @@ func do_crash_reporting
        bl      do_cpu_reg_dump
        bl      str_in_crash_buf_print
 
-       /* Print the gic registers */
-       plat_print_gic_regs
-
-       /* Print the interconnect registers */
-       plat_print_interconnect_regs
+       /* Print some platform registers */
+       plat_crash_print_regs
 
        /* Done reporting */
        bl      plat_panic_handler
index 5e14823214a2843cd583e91a93402e667d0c04ca..0d713c4ad9175946a6534938ef0913c3bb412581 100644 (file)
@@ -489,20 +489,15 @@ Each platform must ensure a file of this name is in the system include path with
 the following macro defined. In the ARM development platforms, this file is
 found in `plat/arm/board/<plat_name>/include/plat_macros.S`.
 
-*   **Macro : plat_print_gic_regs**
+*   **Macro : plat_crash_print_regs**
 
-    This macro allows the crash reporting routine to print GIC registers
-    in case of an unhandled exception in BL31. This aids in debugging and
-    this macro can be defined to be empty in case GIC register reporting is
-    not desired.
-
-*   **Macro : plat_print_interconnect_regs**
-
-    This macro allows the crash reporting routine to print interconnect
+    This macro allows the crash reporting routine to print relevant platform
     registers in case of an unhandled exception in BL31. This aids in debugging
-    and this macro can be defined to be empty in case interconnect register
-    reporting is not desired. In ARM standard platforms, the CCI snoop
-    control registers are reported.
+    and this macro can be defined to be empty in case register reporting is not
+    desired.
+
+    For instance, GIC or interconnect registers may be helpful for
+    troubleshooting.
 
 
 2.2 Handling Reset
index 40f9d7e068d062756238ebb9503924c37310b63d..902fb159cdcbea08085c8eefdf62fa3a6c681d7c 100644 (file)
@@ -44,7 +44,7 @@ cci_iface_regs:
         * Clobbers: x0 - x9, sp
         * ------------------------------------------------
         */
-       .macro plat_print_interconnect_regs
+       .macro print_cci_regs
        adr     x6, cci_iface_regs
        /* Store in x7 the base address of the first interface */
        mov_imm x7, (PLAT_ARM_CCI_BASE + SLAVE_IFACE_OFFSET(    \
index 9124fdc7700972258357b7d93437fede20e048b8..518867bd169f59454132022170f2a235d24137ed 100644 (file)
@@ -40,7 +40,7 @@
         * Clobbers: x0 - x10, x16, x17, sp
         * ---------------------------------------------
         */
-       .macro plat_print_gic_regs
+       .macro css_print_gic_regs
        mov_imm x16, PLAT_ARM_GICD_BASE
        mov_imm x17, PLAT_ARM_GICC_BASE
        arm_print_gic_regs
index df66a52083951eeae424168cbdbba22ec62d2850..e43c7acfcbc905be522e7192924261339257ebf4 100644 (file)
 
        /* ---------------------------------------------
         * The below required platform porting macro
-        * prints out relevant GIC registers whenever an
-        * unhandled exception is taken in BL31.
+        * prints out relevant GIC and CCI registers
+        * whenever an unhandled exception is taken in
+        * BL31.
         * Clobbers: x0 - x10, x16, x17, sp
         * ---------------------------------------------
         */
-       .macro plat_print_gic_regs
+       .macro plat_crash_print_regs
        /*
         * Detect if we're using the base memory map or
         * the legacy VE memory map
@@ -63,6 +64,7 @@ use_ve_mmap:
        mov_imm x16, VE_GICD_BASE
 print_gic_regs:
        arm_print_gic_regs
+       print_cci_regs
        .endm
 
 #endif /* __PLAT_MACROS_S__ */
index d2a88edb709815b620eb545eee4291891da8e8cd..bb42bca4c750c8e5c90e091b7d2f69b037588307 100644 (file)
 #include <cci_macros.S>
 #include <css_macros.S>
 
-/*
- * Required platform porting macros
- * (Provided by included headers)
- */
-
+       /* ---------------------------------------------
+        * The below required platform porting macro
+        * prints out relevant platform registers
+        * whenever an unhandled exception is taken in
+        * BL31.
+        * ---------------------------------------------
+        */
+       .macro plat_crash_print_regs
+       css_print_gic_regs
+       print_cci_regs
+       .endm
 
 #endif /* __PLAT_MACROS_S__ */
index 0e34b1978cff9fdf6ba0c546f3f71b7857c4b13d..018a790a745372a6aaf156b364b20e783ecbe01c 100644 (file)
@@ -43,14 +43,18 @@ newline:
 spacer:
        .asciz ":\t\t0x"
 
+.section .rodata.cci_reg_name, "aS"
+cci_iface_regs:
+       .asciz "cci_snoop_ctrl_cluster0", "cci_snoop_ctrl_cluster1" , ""
+
        /* ---------------------------------------------
-        * The below macro prints out relevant GIC
-        * registers whenever an unhandled exception is
-        * taken in BL3-1.
+        * The below macro prints out relevant GIC and
+        * CCI registers whenever an unhandled exception
+        * is taken in BL3-1.
         * Clobbers: x0 - x10, x16, x17, sp
         * ---------------------------------------------
         */
-       .macro plat_print_gic_regs
+       .macro plat_crash_print_regs
        mov_imm x16, BASE_GICD_BASE
        mov_imm x17, BASE_GICC_BASE
        /* Load the gicc reg list to x6 */
@@ -82,20 +86,7 @@ gicd_ispendr_loop:
        bl      asm_print_str
        b       gicd_ispendr_loop
 exit_print_gic_regs:
-       .endm
 
-.section .rodata.cci_reg_name, "aS"
-cci_iface_regs:
-       .asciz "cci_snoop_ctrl_cluster0", "cci_snoop_ctrl_cluster1" , ""
-
-       /* ------------------------------------------------
-        * The below macro prints out relevant interconnect
-        * registers whenever an unhandled exception is
-        * taken in BL3-1.
-        * Clobbers: x0 - x9, sp
-        * ------------------------------------------------
-        */
-       .macro plat_print_interconnect_regs
        adr     x6, cci_iface_regs
        /* Store in x7 the base address of the first interface */
        mov_imm x7, (PLAT_MT_CCI_BASE + SLAVE_IFACE_OFFSET(     \
index 0868b416f0a88d870543db41ca656dcd7e244d2c..1afe4545524fcffa0bf2a264ef6a5fbe4d0ce392 100644 (file)
@@ -50,7 +50,7 @@ spacer:
  * taken in BL31.
  * ---------------------------------------------
  */
-.macro plat_print_gic_regs
+.macro plat_crash_print_regs
        mov_imm x16, TEGRA_GICC_BASE
        cbz     x16, 1f
        /* gicc base address is now in x16 */
@@ -81,14 +81,4 @@ spacer:
 1:
 .endm
 
-/* ------------------------------------------------
- * The below required platform porting macro prints
- * out relevant interconnect registers whenever an
- * unhandled exception is taken in BL3-1.
-  * ------------------------------------------------
- */
-.macro plat_print_interconnect_regs
-       nop
-.endm
-
 #endif /* __PLAT_MACROS_S__ */
index ce68cf16a27a72e27d701b3ab9534092998eacb0..dcc959f8eacb0f9d881dd541e3d956a5e4e72f07 100644 (file)
@@ -54,15 +54,19 @@ newline:
 spacer:
        .asciz ":\t\t0x"
 
+.section .rodata.cci_reg_name, "aS"
+cci_iface_regs:
+       .asciz "cci_snoop_ctrl_cluster0", "cci_snoop_ctrl_cluster1" , ""
+
        /* ---------------------------------------------
         * The below utility macro prints out relevant GIC
-        * registers whenever an unhandled exception is
-        * taken in BL31 on ARM standard platforms.
+        * and CCI registers whenever an unhandled
+        * exception is taken in BL31.
         * Expects: GICD base in x16, GICC base in x17
         * Clobbers: x0 - x10, sp
         * ---------------------------------------------
         */
-       .macro plat_print_gic_regs
+       .macro plat_crash_print_regs
 
        mov_imm x16, PLAT_RK_GICD_BASE
        mov_imm x17, PLAT_RK_GICC_BASE
@@ -119,20 +123,7 @@ gicd_ispendr_loop:
        bl      asm_print_str
        b       gicd_ispendr_loop
 exit_print_gic_regs:
-       .endm
 
-.section .rodata.cci_reg_name, "aS"
-cci_iface_regs:
-       .asciz "cci_snoop_ctrl_cluster0", "cci_snoop_ctrl_cluster1" , ""
-
-       /* ------------------------------------------------
-        * The below macro prints out relevant interconnect
-        * registers whenever an unhandled exception is
-        * taken in BL3-1.
-        * Clobbers: x0 - x9, sp
-        * ------------------------------------------------
-        */
-       .macro plat_print_interconnect_regs
 #if PLATFORM_CLUSTER_COUNT > 1
        adr     x6, cci_iface_regs
        /* Store in x7 the base address of the first interface */
index e6c39bb51f68849dbf3266290e55a2e2abfb2f77..f40beba81e7677bc77b85ba232f63e910acd8800 100644 (file)
 
        /* ---------------------------------------------
         * The below required platform porting macro
-        * prints out relevant GIC registers whenever an
-        * unhandled exception is taken in BL31.
-        * Clobbers: x0 - x10, x16, sp
+        * prints out relevant GIC and CCI registers
+        * whenever an unhandled exception is taken in
+        * BL31.
+        * Clobbers: x0 - x10, x16, x17, sp
         * ---------------------------------------------
         */
-       .macro plat_print_gic_regs
+       .macro plat_crash_print_regs
        mov_imm x17, BASE_GICC_BASE
        mov_imm x16, BASE_GICD_BASE
        arm_print_gic_regs
-       mov x0, x1
+       print_cci_regs
        .endm
 
 #endif /* __PLAT_MACROS_S__ */